package com.san.simulation.model.api;

public enum ElementType {

	START_EVENT("startevent"),
	END_EVENT("endevent"),
	USER_TASK("usertask"),
	SEQUENCE_FLOW("sequenceflow"),
	EXCLUSIVE_GATEWAY("exclusivegateway"),
	PARALLEL_GATEWAY("parallelgateway"), 
	RECEIVE_TASK("receivetask");
	
	private String typeStr;
	
	private ElementType(String typeStr) {
		this.typeStr = typeStr;
	}
	
	public String getStringValue() {
		return this.typeStr;
	}
	
	public static ElementType convert(String customType) {
		
		return ElementType.valueOf(customType.toLowerCase());
	}
	
	public boolean isValid(String type) {
		if (this.equals(type) || this.typeStr.equalsIgnoreCase(type)) {
			return true;
		}
		
		return false;
	}
}
